package hander

import (
	"context"
	"rpc-server/internal/dao"
	"rpc-server/internal/model"
	__ "rpc-server/proto"
)

type UserServer struct {
	__.UnimplementedUserServer
}

func (c *UserServer) Register(_ context.Context, in *__.RegisterRequest) (*__.RegisterResponse, error) {
	dao.Create(&model.User{
		Username: in.Username,
		Password: in.Password,
	})

	return &__.RegisterResponse{
		Code:    200,
		Message: "注册成功",
	}, nil

}
